// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';
const apiPrefix = '/web';

/** 峰谷套利策略下发 POST /fenggu/data/down */
export async function fengguDataControllerDownFengguInfo(
  body: API.DownFengguReq,
  options?: { [key: string]: any },
) {
  return request<API.ApiResult>(`${apiPrefix}/fenggu/data/down`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 分页查询峰谷套利下发记录列表 GET /fenggu/data/downRecordList */
export async function fengguDataControllerGetPageDownRecordList(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.fengguDataControllerGetPageDownRecordListParams,
  options?: { [key: string]: any },
) {
  return request<API.Pagination>(`${apiPrefix}/fenggu/data/downRecordList`, {
    method: 'GET',
    params: {
      ...params,
      req: undefined,
      ...params['req'],
      page: undefined,
      ...params['page'],
    },
    ...(options || {}),
  });
}

/** 根据下发ID查询峰谷套利下发记录 GET /fenggu/data/getDownRecordById/${param0} */
export async function fengguDataControllerGetDownRecordById(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.fengguDataControllerGetDownRecordByIdParams,
  options?: { [key: string]: any },
) {
  const { downId: param0, ...queryParams } = params;
  return request<API.ApiResultListStrategyFengguInfo>(
    `${apiPrefix}/fenggu/data/getDownRecordById/${param0}`,
    {
      method: 'GET',
      params: { ...queryParams },
      ...(options || {}),
    },
  );
}

/** 查询峰谷套利上次下发记录 GET /fenggu/data/lastDownRecord/${param0} */
export async function fengguDataControllerGetLastDownRecord(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.fengguDataControllerGetLastDownRecordParams,
  options?: { [key: string]: any },
) {
  const { stationId: param0, ...queryParams } = params;
  return request<API.ApiResultFengguDataRes>(`${apiPrefix}/fenggu/data/lastDownRecord/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}
